﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

using TLL.Log;

namespace TLL.Drowing
{
    public class Drowing
    {
        private PictureBox diagramCont = null;
        private PictureBox valuesCont = null;
        private PictureBox keyCont = null;
        private Dictionary<DateTime, double> components = null;

        public double MaxValue
        {
            get
            {
                double res = 0;
                foreach (var component in components)
                    if (res < component.Value)
                        res = component.Value;
                return res;
            }
        }
        public double MinValue
        {
            get
            {
                double res = double.MaxValue;
                foreach (var component in components)
                    if (res > component.Value)
                        res = component.Value;
                return res;
            }
        }
        public DateTime MaxDate
        {
            get
            {
                var res = DateTime.MinValue;
                foreach (var component in components)
                    if (res < component.Key)
                        res = component.Key;
                return res;
            }
        }
        public DateTime MinDate
        {
            get
            {
                var res = DateTime.MaxValue;
                foreach (var component in components)
                    if (res > component.Key)
                        res = component.Key;
                return res;
            }
        }
        public Drowing(Dictionary<DateTime, double> components, PictureBox diagramCont, PictureBox valuesCont, PictureBox keyCont)
        {
            this.diagramCont = diagramCont;
            this.valuesCont = valuesCont;
            this.keyCont = keyCont;
            this.components = components;
        }
        

    }
}
